package com.shootforthestars.components;

import org.newdawn.slick.geom.Vector2f;

public class MotionComponent {
	private Vector2f velocity;
	private Vector2f gravity;

	public MotionComponent() {
		velocity = new Vector2f();
		gravity = new Vector2f();
	}
	
	public void update(int delta) {
		velocity.x += gravity.x * delta;
		velocity.y += gravity.y * delta;
	}
	
	public void accelerate(float x, float y) {
		velocity.x += x;
		velocity.y += y;
	}

	public Vector2f getVelocity() {
		return velocity;
	}

	public void setVelocity(float x, float y) {
		velocity.x = x;
		velocity.y = y;
	}
	
	public void setVelocityX(float x) {
		velocity.x = x;
	}
	
	public void setVelocityY(float y) {
		velocity.y = y;
	}

	public Vector2f getGravity() {
		return gravity;
	}

	public void setGravity(float x, float y) {
		gravity.x = x;
		gravity.y = y;
	}
	
	public void setGravityX(float x) {
		gravity.x = x;
	}
	
	public void setGravityY(float y) {
		gravity.y = y;
	}
}
